using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks; 
using App.DAL;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.Extensions.DependencyInjection;

namespace App.Pages
{
    public class IndexModel : PageModel
    { 

        public void OnGet()
        {

            // Microsoft.AspNetCore.Http.HttpContextAccessor fac =(Microsoft.AspNetCore.Http.HttpContextAccessor)factory;
            //Microsoft.AspNetCore.Http.HttpContext context = ((Microsoft.AspNetCore.Http.HttpContextAccessor)factory).HttpContext;

            SysUser sys = new SysUser();
            sys.Account = "123";
            sys.CreateDt = DateTime.Now;
            sys.Insert();

            ViewData["SysUserTotal"] = SysUser.Search().Count().ToString();


            //ViewData["SysUserTotal"] =App.Components.GlobalVar.ServiceProvider.GetService<App.DAL.AppContext>().SysUsers.Select.Count().ToString();// App.BLL.GlobalVar.DB.SysUsers.Select.Count().ToString();
            //Response=appContext.SysUsers.Select.Count().ToString();
        }

    }
}
